enum Direct{
    Up, 
    Down,
    Left,
    Right
}



// enum Direct{
//     Up , 
//     Down,
//     Left = 5,
//     Right
// }



console.log(Direct)
// console.log(Direct[0])
// console.log(Direct[1])

function walk(dir:Direct){
    if (dir === Direct.Up) {
         console.log("向【上】⾛"); 
    } else if (dir === Direct.Down) {
         console.log("向【下】⾛");
    } else if (dir === Direct.Left) {
        console.log("向【左】⾛"); 
    } else if (dir === Direct.Right) {
        console.log("向【右】⾛"); 
    } else {
        console.log("未知⽅向"); 
    } 
}

walk(Direct.Down)




